package com.kd.spring.service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.kd.spring.dao.UserDao;

@Service("userService")
@Scope("")//指定bean的作用域
public class UserService {
	@Autowired //bean的自动装配
	private UserDao userDao;

	public void regiest() {
		System.out.println(userDao);
	}
	
	@PostConstruct 
	public void init(){
		System.out.println("UserService 初始化&");
	}
	
	@PreDestroy  
	public void destroy(){
		System.out.println("UserService 销毁&");
	}
}
